package com.linh.location;

import android.graphics.drawable.Drawable;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class PointOverlay extends ItemizedOverlay<OverlayItem> {

	GeoPoint geoPoint;

	public PointOverlay(Drawable drawable) {
		super(boundCenterBottom(drawable));
		populate();

	}

	public void setPoint(GeoPoint point) {
		this.geoPoint = point;
		populate();
	}

	@Override
	protected OverlayItem createItem(int i) {
		return new OverlayItem(geoPoint, null, null);
	}

	@Override
	public int size() {
		if (geoPoint == null) {
			return 0;
		} else {
			return 1;
		}
	}

	@Override
	protected boolean onTap(int arg0) {
		return true;
	}

}
